package com.xbongbong.sys.model;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.saas.domain.entity.SharePermissionSetUserEntity;
import com.xbongbong.saas.domain.entity.ShareRuleEntity;

import java.util.List;
import java.util.Map;

/**
 * @description: 共享权限规则授权用户 Model
 * @Author: leex
 */
public interface SharePermissionSetUserModel extends IModel<SharePermissionSetUserEntity> {

    Integer insert(SharePermissionSetUserEntity entity);
    /**
     * 批量插入数据库
     * @param list 数据实体列表
     */
    void insertBatch(List<SharePermissionSetUserEntity> list);

    Integer update(SharePermissionSetUserEntity entity) throws XbbException;

    void updateBatch(String corpid, List<SharePermissionSetUserEntity> list) throws XbbException;

    Integer deleteByKey(Long key, String corpid);

    Integer deleteByShareRuleId(Long shareRuleId, String corpid, Long formId);

    Integer deleteByFormId(String corpid, Long formId);

    void deleteBatch(String corpid, List<Long> idIn);

    SharePermissionSetUserEntity getByKey(Long key, String corpid);

    List<SharePermissionSetUserEntity> getByShareRuleId(Long shareRuleId, String corpid);

    List<SharePermissionSetUserEntity> findEntitys(Map<String ,Object>  param);

    Integer getEntitysCount(Map<String ,Object> param);

    List<SharePermissionSetUserEntity> getEntitysByUsersAndForm(String corpid, Long formId, List<String> userIdIn);
}
